package com.message.tcp.ip.ui.member;

import java.awt.BorderLayout;
import java.awt.FlowLayout;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.table.DefaultTableModel;

public class DataElementPanel extends JPanel {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private JPanel menuPanel;
	private JLabel deLabel;
	private JTextField deTextField;
	private JButton searchButton;
	private JButton updateButton;
	private JButton deleteButton;
	private JScrollPane scrollPane;
	private JTable deTable;
	
	public DataElementPanel(){
		menuPanel = new JPanel();
		deLabel = new JLabel("Data Element");
		deTextField = new JTextField(10);
		searchButton = new JButton("Search");
		updateButton = new JButton("Update");
		deleteButton = new JButton("Delete");
		menuPanel.setLayout(new FlowLayout());
		menuPanel.add(deLabel);
		menuPanel.add(deTextField);
		menuPanel.add(searchButton);
		menuPanel.add(updateButton);
		menuPanel.add(deleteButton);
		
		String[] columnName = {"ID","DE","Value","Definition"};
		Object[][] data = null;
		DefaultTableModel model = new DefaultTableModel(data,columnName);
		deTable = new JTable(model);
		deTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
		scrollPane = new JScrollPane(deTable);
		this.setLayout(new BorderLayout());
		this.add(menuPanel,BorderLayout.NORTH);
		this.add(scrollPane,BorderLayout.CENTER);
	}
}
